﻿
@{
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Index</title>
    <link href="~/Css/StyleSheet2.css" rel="stylesheet" />
</head>
<body>
    <div>
        <input id="fileName" type="hidden" value="@ViewBag.fileName" />
        <input id="pwd" type="text" style="display: block;" />
        <button id="button" style="text-align: center;">Verify</button>
    </div>
    <script src="~/Scripts/jquery-1.9.0.min.js"></script>
    <script type="text/javascript">
        $(function () {
            $('#button').click(function() {
                var pwd = $('#pwd').val();
                if (pwd != null && pwd != '') {
                    var fileName = $('#fileName').val();

                    if (fileName == '')
                        return;
                    $.ajax({

                        url: '/Notepad/Index',
                        type: 'POST',
                        data: {pwd:pwd,uri:fileName},
                        success: function(data) {
                            if (data != 'no')
                                location.href = '/Home/Index?fileName=' + data + '&status=pass';

                        },
                        error: function(a, o, e) {
                            alert('异常' + e.toString());
                        }
                    });
                }
            });


        })
    </script>
</body>
</html>
